import { TemplateEducationExperience } from '@/modules/resume/models/template-detail.types';
import React, { FC } from 'react';
import { CommonHeadLine } from './CommonHeadLine';
import { CommonListExperience } from './CommonListExperience';

const COM_PREKEY = 'CommonEducationExperiences';

interface CommonEducationExperienceProps extends TemplateEducationExperience {}

const CommonEducationExperience: FC<CommonEducationExperienceProps> = (props) => {
    return (
        <>
            <CommonHeadLine
                lineTexts={[props.schoolName, props.educationBackground, props.major]}
                from={props.fromYear?.toString()}
                to={props.toYear?.toString()}
            />
            {props.experiences?.length > 0 && (
                <div className="edu-content">
                    <CommonListExperience experiences={props.experiences} />
                </div>
            )}
        </>
    );
};

CommonEducationExperience.displayName = 'CommonEducationExperience';

export { CommonEducationExperience, CommonEducationExperienceProps };
